<?php
namespace globalunit\model;
use globalunit\model\BaseModel;
use globalunit\utils\DBClass;
use QYS\Util\Debug;
use QYS\Core\Config as CoreConfig;
use globalunit\utils\Config;

Class MenuModel extends BaseModel
{
    public $id              = 0;         //id
    public $pid             = 0;         //pid
    public $name            = '';        //名称
    public $path            = '';        //路由
    public $component       = '';        //组件
    public $hidden          = 0;         //在不在侧边栏线上 0在 1不在
    public $redirect        = '';        //重定向地址，在面包屑中点击会重定向去的地址
    public $alwaysShow      = 0;         //一直显示根路由 0不显示 1显示
    public $meta            = '';        //设置标题  icon  权限等
    public $ctime           = 0;         //添加时间
    public $utime           = 0;         //修改时间
    protected $_validator = [
        'id' => [
            'ac' =>'id'
        ]
    ];


    public function __construct($mysql) {
        parent::__construct($mysql,'s_menu');
    }

    public function insert()
    {
        return parent::insert();
    }

    public function save(){
        if($this->id > 0){
            return parent::save();
        }
    }

    public function toArray(){
        $a = parent::toArray();
        return $a;
    }


}
